Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rlgl] [rshapes] [rtextures] Fixes for disabled SUPPORT_QUADS_DRAW_MODE #4296

Closed
wants to merge 6 commits into from

Conversation

Destructor17
Copy link

@Destructor17 Destructor17 commented Aug 30, 2024

While trying to make raylib work in WASI and OpenGL ES, i figured out that my OpenGL ES driver does not supports quads draw mode. But disabling SUPPORT_QUADS_DRAW_MODE leads to following bugs:

  • Many elements are still using RL_QUADS mode.
  • Many elements are displayed with default texture.

I tried a few examples and managed to fix RL_QUADS bug for them (that was hard due to way debugger in wasmtime works). Fixes are straightforward, but it is likely that RL_QUADS is still used in some raylib modules and examples. BTW there is an alternative way to solve this problem: emulating RL_QUADS using triangles and pushing 2 additional vertices every 4th call of rlVertex3f. I guess it worth investigating.

Honestly i don't know how textures worked before, but in my case i had to make raylib restore texture(which is usually set by rlSetTexture before rlBegin call) when draw mode switches (inspired by #2018)

@Destructor17
Copy link
Author

Destructor17 commented Aug 31, 2024

It looks like the texture bug is known. In textures_polygon.c, there is a // Texturing is only supported on RL_QUADS comment. Restoring texture on rlBegin call makes this example work with triangles well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant